<%-- 
    Document   : EditingProfile
    Created on : Nov 23, 2012, 10:35:52 AM
    Author     : vupttse
--%>


<%@page import="assignment2.stub.UsersTbl_Stub"%>
<%@page import="assignment2.data.Users"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        
    </head>
    <body>
        <%
        Users user = (Users)session.getAttribute("currentUser");
        UsersTbl_Stub usersTbl_Stub = new UsersTbl_Stub();
        String username = user.getUserName();
        String gender = request.getParameter("gender");
        String fullName = request.getParameter("fullName");
        String tel = request.getParameter("tel");
        String address = request.getParameter("address");        
        String nationality = request.getParameter("nationality");
        usersTbl_Stub.UpdateStaff(gender, fullName, tel, address, nationality, username);
        user = UserDAL.getUser(username);
        session.setAttribute("currentUser", user);
        %>
        <script>
            alert("Editing successful! Click OK to go back!");           
        </script>
        <%
        response.sendRedirect("Home.jsp");
        %>
    </body>
</html>
